package handlers

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/loopfz/gadgeto/tonic"
)

type MyInput struct {
	Foo int    `path:"foo" validate:"required,gt=10"`
	Bar string `query:"bar" default:"foobar" validate:"nefield=Baz"`
	Baz string `json:"baz" validate:"required,email"`
}

func addMyinput(root *gin.Engine) {
	g := root.Group("/myinput")
	g.POST("/add/:foo", tonic.Handler(func(c *gin.Context, in *MyInput) error {
		fmt.Printf("--------in---%+v  \n", in)
		return nil
	}, 200))

}
